package com.snowy.hidden.constant;

import lombok.Getter;

import java.util.Arrays;

/**
 * <p>
 * 交易中心-审批状态 枚举类
 * 待审核、审核通过、审核不通过
 * </p>
 *
 * @author：Lei.y
 * @date：2022/5/11 15:42
 */
@Getter
public enum HiddenTypeEnum {
    //隐患类型 1：第三方施工2：堡坎垮塌3：露管4：违章施工5：其它
    one(1,"第三方施工"),
    two(2,"堡坎垮塌"),
    three(3,"露管"),
    four(4,"违章施工"),
    five(5,"其它"),
    ;

    private Integer code;
    private String desc;

    HiddenTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static HiddenTypeEnum getEnum(Integer code) {
        return Arrays.stream(HiddenTypeEnum.values()).filter(item -> item.getCode().equals(code)).findFirst().get();
    }
}
